home *** CD-ROM | disk | FTP | other *** search
/ The Best of MacTutor - S…e Code for Volumes 1 to 5 / The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin / Source Code / #02 (Apr85-Jul85) / modula 2 / modula Vol. 1 #8 / VolumeTracer.DEF < prev    next >
Text File  |  1985-05-09  |  2KB  |  49 lines

  1. DEFINITION MODULE VolumeTracer;
  2.  
  3.   FROM MacSystemTypes IMPORT LongCard, Ptr;
  4.  
  5.   EXPORT QUALIFIED VCB, VolumesOnLine, GetVolumeInfo;
  6.  
  7.   TYPE
  8.     QElemPtr = POINTER TO VCB;
  9.  
  10.     VCB = RECORD
  11.               qLink:                  QElemPtr;    (* next queue entry *)
  12.         qType:                  INTEGER;       (* not used *)
  13.         vcbFlags:             INTEGER;       (* bit 15=1 if dirty *)
  14.         vcbSigWord:        INTEGER;       (* always $D2D7 *)
  15.         vcbCrDate:        LongCard;     (* date volume was initialized *)
  16.         vcbLsBkUp:        LongCard;     (* date of last backup *)
  17.         vcbAtrb:             INTEGER;       (* volume attributes *)
  18.         vcbNmFls:             INTEGER;       (* number of files in directory *)
  19.         vcbDirSt:             INTEGER;       (* directory's first block *)
  20.         vcbBlLn:             INTEGER;       (* length of file directory *)
  21.         vcbNmBlks:        INTEGER;       (* number of allocation blocks *)
  22.         vcbAlBlkSiz:         LongCard;     (* size of allocation blocks *)
  23.         vcbClpSiz:             LongCard;     (* number of bytes to allocate *)
  24.         vcbAlBlSt:             INTEGER;       (* first block in block map *)
  25.         vcbNxtFNum:        LongCard;     (* next unused file number *)
  26.         vcbFreeBks:        INTEGER;       (* number of unused blocks *)
  27.         vcbVN:    ARRAY [0..27] OF CHAR;(* volume name Str255 format *)
  28.         vcbDrvNum:        INTEGER;       (* drive number *)
  29.         vcbDRefNum:        INTEGER;       (* driver reference number *)
  30.         vcbFSID:             INTEGER;       (* file system identifier *)
  31.         vcbVRefNum:        INTEGER;       (* volume reference number *)
  32.         vcbMAdr:             Ptr;              (* location of block map *)
  33.         vcbBufAdr:        Ptr;              (* location of volume buffer *)
  34.         vcbMLen:             INTEGER;       (* number of bytes in block map *)
  35.         vcbDirIndex:         INTEGER;       (* used internally *)
  36.         vcbDirBlk:             INTEGER;       (* used internally *)
  37.       END;
  38.  
  39.   PROCEDURE VolumesOnLine(): CARDINAL;
  40.   (* Returns the maximum number of volumes currently recognized by the
  41.        Mac operating system. *)
  42.  
  43.   PROCEDURE GetVolumeInfo(VAR volume : VCB; whichVol : CARDINAL);
  44.   (* Returns the current VCB block for volume "whichVol"  The variable
  45.        "whichVol" must be between 1 and the result of the procedure of
  46.        "VolumesOnLine()".  Otherwise, the "volume" info is undefined. *)
  47.  
  48. END VolumeTracer.
  49.